<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<style>
	#userList {
		width: 1024px;
		height: 600px;
		margin: 0 auto 0 auto;
	}
	
	#userListTable {
		width: 800px;
		margin: 100px auto 0 auto;
		border: 1px solid;
		border-collapse: collapse;
	}
	#userListTable td, #userListTable th {
		border: 1px solid;
	}
</style>
<script>
	window.onload = function() {
		var name = "andy";
		var bName = "alex";
	}
</script>
</head>
<body>
	<div id="userList">
		<div id="messageDiv">
			<c:if test="${not empty message}">
				<script type="text/javascript">
					alert('${message}');
				</script>
			</c:if>
		</div>
		
		<a href="changeLocale?localeType=en_US"><spring:message code="page.index.english" /></a> | 
		<a href="changeLocale?localeType=zh_CN"><spring:message code="page.index.chinese" /></a><br />
		<a href="add"><spring:message code="page.index.add" /></a>
		<table id="userListTable">
			<tr>
				<th><spring:message code="page.index.id" /></th>
				<th><spring:message code="page.index.name" /></th>
				<th><spring:message code="page.index.age" /></th>
				<th><spring:message code="page.index.option" /></th>
			</tr>
			<c:forEach items="${userList}" var="user">
				<tr>
					<td>${user.id }</td>
					<td>${user.name }</td>
					<td>${user.age }</td>
					<td><a href="edit/${user.id }">${edit }</a>&nbsp;<a href="delete/${user.id }">${delete }</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>